//package com.example.publishDemo.Controller.SystemMessage;
//
//import com.example.publishDemo.Model.MessageInfo;
//import org.springframework.amqp.core.AmqpTemplate;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.data.redis.connection.stream.Record;
//import org.springframework.data.redis.connection.stream.RecordId;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//import java.util.HashMap;
//import java.util.Map;
//
//@Component
//public class SystemMessageConsumer {
//
//    @Resource
//    AmqpTemplate amqpTemplate;
//
//    @Resource
//    RedisTemplate redisTemplate;
//
//    @RabbitListener(queues = "systemTopicQueue")
//    public void handleSystemMessage(MessageInfo message) {
//
//        Map<Integer, Object> map = new HashMap<>();
//        map.put(message.getM_id() , message);
//        RecordId systemMessage = redisTemplate.opsForStream().add("SystemMessage", map);
//        redisTemplate.opsForStream().acknowledge("SystemMessageGroup", Record.of(map));
//        System.out.println("systemTopicQueue_Received message:"+message.getMessage());
//    }
//}
